from peewee import CharField

from application.db import get_database_connection
from application.db.mysql_db.base_mysql_model import BaseMysqlModel


class CnArticleAuthorPlatformIdRelation(BaseMysqlModel):
    """中文文献库文献作者对应各平台作者标识关系表"""
    author_id = CharField(max_length=32)  # 作者ID，表cn_article_author_list标识
    platform_id = CharField(max_length=255, index=True)  # 第三方平台的作者ID
    platform_code = CharField(max_length=255)  # 平台代码，取值["yiigle"(中华医学数据库), "cnki"(知网), ...]

    class Meta:
        table_name = 'cn_article_author_platform_id_relation'
        database = get_database_connection('default')  # 使用默认数据库